home *** CD-ROM | disk | FTP | other *** search
/ Freaks Macintosh Archive / Freaks Macintosh Archive.bin / Freaks Macintosh Archives / Hacking & Misc / bundle of exploits.sit / bundle of exploits / phunk.c < prev    next >
C/C++ Source or Header  |  1995-08-05  |  2KB  |  63 lines

  1. /* /===============------ - - ---- - -           - -            */
  2. /* |             -* pHUNk v0.0.2 *-                */
  3. /* | wERD!  this is only my third C program EVER!             */
  4. /* | so if you think it sux, and could be written            */
  5. /* | better, you're absolutely right..                  */
  6. /* |                                     */
  7. /* | It's mainly based on James Manning's random.c,            */
  8. /* | and set_to_lower() is even taken right out of            */
  9. /* | random.c! =)                            */
  10. /* |                                     */
  11. /* | to use, type "/alias phunk /exec -out echo "$0-" |phunk"        */
  12. /* | inside of irc!  then type "/phunk your message"            */
  13. /* |        -oMIkRON / rEMORSE.aSCII     (omi on irc)                */    
  14. /* \==============-==-=======--------- ---- - -      ---   - -     -    */
  15.                                     
  16. #include <stdio.h>
  17. #include <stdlib.h>
  18.  
  19. /* tHIS^tAKEN^fROM rANDOM.sEE! */
  20. char set_to_lower(char tmp){
  21. char x = tmp;
  22. if((x<='Z')&&(x>='A')) {
  23.    x -= 'A';
  24.    x += 'a';
  25.    }
  26. return x;
  27. }
  28. /* eND^rANDOM.sEE^sHIT */
  29.  
  30. main() {
  31.    char a_char;
  32.    int low;
  33.    low = 1;
  34.    a_char = getchar();
  35.    while(a_char!=EOF) {
  36.     if (low == 0) {
  37.            a_char = toupper(a_char);
  38.     }    
  39.     
  40.     if (low == 1) {
  41.        a_char = set_to_lower(a_char);
  42.        low = 0;
  43.     }
  44.  
  45.     if (a_char == ' ') {
  46.        a_char = '^';
  47.        low = 1;
  48.     }
  49.  
  50.  /* if you don't want colors, comment out the switch() shit! */
  51.  /* I think it looks better without colors, but Slammer requested colors */
  52.     switch(rand()%3) {
  53.        case(0): printf("\002"); break;
  54.        case(1): printf("\037"); break;
  55.        case(2): printf("\026"); break;
  56.     }
  57.     /* end of switch shit */
  58.  
  59.     printf("%c",a_char);
  60.     a_char = getchar();
  61.    }
  62. }
  63.